<script type="text/javascript">
    $(function () {
        toastr.options = {
            "positionClass": "toast-top-right",
            "showDuration": "300",
            "hideDuration": "1000",
            "timeOut": "10000",
            "extendedTimeOut": "1000",
            "showEasing": "swing",
            "hideEasing": "linear",
            "showMethod": "fadeIn",
            "hideMethod": "fadeOut"
        }
    });

    @if(Session::has('code'))
        @if(session('code') == 0)
            toastr['success']("{{session('msg')}}");
        @elseif(session('code') == 1)
            toastr['error']("{{session('msg')}}");
        @endif
    @endif

    {{-- 错误提醒 --}}
    @if(count($errors) > 0)
        @foreach($errors->all() as $err)
            toastr["error"]("{{$err}}");
        @endforeach
    @endif
</script>